package chixing.day07.inherited;

public class DiscountProduct extends Product {

    private float discountRare;
    //构造函数 constructor
    //get set
    //toString
    public DiscountProduct() {
        super();//默认调用父类的无参构造函数
    }

    public DiscountProduct(int proNo,String proName, float proPrice, float discountRare) {
        super(1,proName, proPrice);
        this.discountRare = discountRare;
    }
    public void fun1() {
        super.getProName();// Product 直接父类继承的
        super.hashCode();// Object 超级父类继承的
    }

    public float getDiscountRare() {
        return discountRare;
    }

    public void setDiscountRare(float discountRare) {
        this.discountRare = discountRare;
    }

    @Override
    public String toString() {
        return super.toString() +"DiscountProduct{" +
                "discountRare=" + discountRare +
                '}';
    }
}
